CROSS_COMPILE ?= mips-linux-gnu-

KERNEL_DIR = /home_a/huanwang/work/isvp/opensource/kernel

KDIR := ${KERNEL_DIR}
MODULE_NAME := KprobeModule

all: modules

.PHONY: modules clean

EXTRA_CFLAGS += -I$(PWD)/include

$(MODULE_NAME)-objs := kprobe_mw.o

obj-m := $(MODULE_NAME).o

modules:
	@$(MAKE) -C $(KDIR) M=$(shell pwd) $@

clean:
	@find . -name '*.o' -o -name '*~' -o -name '.depend' -o -name '.*.cmd' \
		-o -name '*.mod.c' -o -name '.tmp_versions' -o -name '*.ko' \
		-o -name '*.symvers' -o -name 'modules.order' | xargs rm -rf
